package com.xbongbong.pro.service.market.statistics.config;

import com.xbongbong.pro.service.market.statistics.MarketActivity4StaticHandle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * @auther: yingjianfeng
 * @Date: 2022/3/15 14:28
 * @Description: 市场活动图表统计
 */
@Configuration
public class MarketActivity4StaticConfig {
    @Autowired
    private Map<String, MarketActivity4StaticHandle> marketActivity4StaticMap;

    @Bean("marketActivity4StaticMap")
    public Map<Integer, MarketActivity4StaticHandle> initMarketActivity4StaticMapExecute() {
        return marketActivity4StaticMap.values().stream().collect(Collectors.toMap(MarketActivity4StaticHandle::type, t -> t));
    }
}
